/* app/assets/stylesheets/application.css */
/*
 *= require_tree .
 *= require_self
 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&display=swap');
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Styles de base */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  /* La transition est gérée dans le inline CSS */
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Playfair", serif;
}
p {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ====================================== */
/* Header & Navigation */
/* ====================================== */

.top-bar {
  background-color: transparent;
  padding: 0px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
  color: var(--text-primary);
}

.top-bar a{
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
}

.text-content {
            color: var(--text-color-dark);
            text-align: center; /* Centré par défaut (mobile) */
            padding: 2rem;
            display: flex;
            flex-direction: column;
            justify-content: center;
            height: 10%;
        }

.main-title {
            color: var(--text-logo);
            font-weight: 900;
            text-transform: uppercase;
            line-height: 0.9;
            margin-bottom: 0.5;
        }

        /* Tailles de police réactives pour le titre */
        .main-title .small-text { font-size: 1rem; display: block; }
        .main-title .big-text { font-size: 2rem; display: block; }

[data-theme="dark"] .top-bar {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.le-header {
  background-color: #8b4367;
}

.le-header .nav {
  background-color: transparent;
  padding: 20px 0;
  transition: background-color 0.3s ease;
}
.le-header .nav-link {
  color: var(--text-menu);
  font-weight: 500;
  margin: 0 15px;
  transition: color 0.3s ease;
  text-transform: uppercase;
  font-size: 10px;
}

.nav-link:hover {
  color: var(--accent-pink);
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 0px;
  transition: color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  color: var(--accent-pink);
}


/* ==========================================================================
   MEGA MENU : STRUCTURE & CORRECTIF DE SURVOL
   ========================================================================== */

/* 1. Rend le parent statique pour que le menu prenne la largeur de la page */
.mega-dropdown {
  position: static !important;
}

/* 2. Le conteneur du Mega Menu */
.dropdown-menu.mega-menu {
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  background-color: var(--bg-menu);
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  
  /* POSITIONNEMENT ET ANIMATION */
  display: block !important; /* Nécessaire pour l'animation */
  opacity: 0;
  visibility: hidden;
  top: 100%; /* Se place juste sous la navbar */
  margin-top: 0 !important; /* Colle le menu au plus près */
  
  /* TAMPON DE SÉCURITÉ #1 : TEMPORISATION */
  /* On attend 0.2s avant de cacher le menu quand la souris part */
  transition: all 0.3s ease;
  transition-delay: 0.2s; 
  
  pointer-events: none; /* Empêche les clics quand invisible */
  overflow: visible !important; /* CRUCIAL pour le pont invisible */
}

/* 3. TAMPON DE SÉCURITÉ #2 : LE PONT INVISIBLE (THE GAP FIX) */
/* Crée une zone transparente au-dessus du menu qui capte la souris */
.dropdown-menu.mega-menu::before {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  
  /* RÉGLAGE DU PONT */
  top: -30px;   /* Remonte de 30px vers le lien de navigation */
  height: 30px; /* Hauteur de la zone de sécurité */
  
  background: transparent; /* Invisible (Change en 'red' pour tester) */
  z-index: 10;
}

.dropdown-menu.mega-menu .card{
  background-color: transparent;
  border: none;

}

/* 4. COMPORTEMENT AU SURVOL (DESKTOP) */
@media all and (min-width: 992px) {
  .hover-dropdown:hover .dropdown-menu.mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    
    /* Annule le délai à l'ouverture pour que ce soit instantané */
    transition-delay: 0s; 
  }
}

/* ==========================================================================
   CONTENU DU MENU : COLONNES & STYLE
   ========================================================================== */

/* Colonnes dynamiques pour les sous-catégories (Gauche) */
.subcategory-dynamic-list {
  column-count: 1;
  column-gap: 20px;
}

@media (min-width: 992px) {
  .subcategory-dynamic-list {
    column-count: 2; /* 2 colonnes automatiques sur grand écran */
  }
}

/* Évite de couper un lien en deux */
.break-avoid {
  break-inside: avoid-column;
  page-break-inside: avoid;
}

/* Effets visuels (Zoom images & Liens) */
.hover-zoom {
  transition: transform 0.3s ease;
}
.card:hover .hover-zoom {
  transform: scale(1.05);
}

.hover-primary:hover {
  color: #0d6efd !important;
  padding-left: 5px;
  transition: all 0.2s ease-in-out;
}

.letter-spacing {
  letter-spacing: 1px;
}


/* ====================================== */
/* Hero Carousel */
/* ====================================== */

.hero-carousel {
  height: 500px;
  position: relative;
}

.carousel-item {
  height: 500px;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  background: linear-gradient(to top, var(--overlay), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.carousel-content {
  max-width: 800px;
  padding: 0 20px;
}

.badge-alune {
  background-color: var(--accent-pink);
  color: white;
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 20px;
}

.carousel-content h1 {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
}

.carousel-content h1::first-letter {
  text-transform: uppercase;
}

.carousel-content h1 a{
  color: white;
  text-decoration: none;
}

.carousel-content p{
  color: white;
  text-decoration: none;
}

.carousel-content p a{
  color: white;
  text-decoration: none;
}

/* ====================================== */
/* Section Titles */
/* ====================================== */


.laune-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 00px;
  margin-left: 1.2%;
  padding: 1%;
  color: var(--text-menu);
  transition: color 0.3s ease;
  background-color: var(--bg-menu);
  width: fit-content;
}

.section-title {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 00px;
  margin-left: 0%;
  margin-top: 5%;
  padding: 1%;
  color: var(--text-menu);
  transition: color 0.3s ease;
  background-color: var(--bg-menu);
  width: fit-content;
}

.section-title::first-letter {
  text-transform: uppercase;
}


/* ====================================== */
/* Article Cards */
/* ====================================== */

.article-card {
  background-color: var(--bg-secondary);
  margin-bottom: 30px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

[data-theme="dark"] .article-card:hover {
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.article-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.article-card-body {
  padding: 20px;
}

.article-card-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.article-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.article-meta a {
  color: var(--accent-pink);
  text-decoration: none;
}

/* ====================================== */
/* Flickity Carousel */
/* ====================================== */

.flickity-carousel {
  margin-bottom: 30px;
}

.carousel-cell {
  width: 300px;
  margin-right: 20px;
}

.flickity-button {
  background-color: var(--accent-pink);
}

.flickity-button:hover {
  background-color: #a02346;
}

.flickity-button svg {
  fill: white;
}

.flickity-page-dots .dot {
  background-color: var(--accent-pink);
}

/* ====================================== */
/* Featured Article Large */
/* ====================================== */

.featured-large {
  position: relative;
  height: 400px;
  overflow: hidden;
  margin-bottom: 30px;
  border-radius: 0px;
}

.featured-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.featured-overlay h3 {
  color: white;
  font-size: 2rem;
  margin-bottom: 10px;
}

.featured-overlay p {
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
}

/* ====================================== */
/* Stories section */
/* ====================================== */

  .stories-carousel-container {
    position: relative;
    width: 100%;
    padding: 20px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    overflow: hidden;
  }
  
  .stories-carousel {
    display: flex;
    gap: 20px;
    padding: 0 60px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .stories-carousel::-webkit-scrollbar {
    display: none;
  }
  
  .story-card-link {
    flex: 0 0 auto;
    text-decoration: none;
    transition: transform 0.3s ease, filter 0.3s ease;
  }
  
  .story-card-link:hover {
    transform: translateY(-10px) scale(1.05);
    filter: brightness(1.1);
    z-index: 10;
  }
  
  .story-card {
    position: relative;
    width: 200px;
    height: 355px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.2);
  }
  
  .story-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
  }
  
  .story-card-link:hover .story-image {
    transform: scale(1.15);
  }
  
  .story-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    background: linear-gradient(
      to top,
      rgba(0,0,0,0.95) 0%,
      rgba(0,0,0,0.7) 50%,
      transparent 100%
    );
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .story-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.9);
    color: #667eea;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
  }
  
  .story-title {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .story-date {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    font-weight: 500;
  }
  
  .carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  }
  
  .carousel-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  }
  
  .carousel-nav.prev {
    left: 10px;
  }
  
  .carousel-nav.next {
    right: 10px;
  }
  
  @media (max-width: 768px) {
    .story-card {
      width: 150px;
      height: 267px;
    }
    
    .story-title {
      font-size: 0.85rem;
    }
    
    .carousel-nav {
      width: 35px;
      height: 35px;
      font-size: 1.5rem;
    }
    
    .stories-carousel {
      padding: 0 50px;
    }
  }
  
  @media (max-width: 480px) {
    .story-card {
      width: 130px;
      height: 231px;
    }
    
    .stories-carousel {
      gap: 12px;
      padding: 0 45px;
    }
  }

/* ====================================== */
/* Interview Section */
/* ====================================== */

.interview-card {
  background-color: var(--bg-secondary);
  overflow: hidden;
  margin-bottom: 30px;
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

.interview-card img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.interview-content {
  padding: 30px;
}

.interview-content h4 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

/* ====================================== */
/* Bons Plans Section */
/* ====================================== */

.bon-plan-card {
  position: relative;
  height: 300px;
  overflow: hidden;
  border-radius: 8px;
}

.bon-plan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bon-plan-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.bon-plan-overlay h5 {
  color: white;
  font-size: 1.2rem;
  margin: 0;
}

/* ====================================== */
/* Footer */
/* ====================================== */

footer {
  background-color: #000;
  color: #fff;
  padding: 60px 0 20px;
  margin-top: 80px;
}

footer h5 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 20px;
  font-family: 'Inter', sans-serif;
}

footer a {
  color: #b0b0b0;
  text-decoration: none;
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent-pink);
}

.social-icons a {
  color: #fff;
  font-size: 1.2rem;
  margin-right: 15px;
  display: inline-block;
  transition: color 0.3s ease, transform 0.2s ease;
}

.social-icons a:hover {
  color: var(--accent-pink);
  transform: scale(1.2);
}

/* ====================================== */
/* Responsive */
/* ====================================== */

@media (max-width: 768px) {
  .carousel-content h1 {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-carousel,
  .carousel-item {
    height: 350px;
  }
  
  .nav-link {
    margin: 5px 0;
  }
}

/* ====================================== */
/* Accessibilité */
/* ====================================== */

*:focus-visible {
  outline: 2px solid var(--accent-pink);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-pink);
  outline-offset: 4px;
}

/* Page article show */
/* ====================================== */
/* Barre de progression de lecture */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-yellow));
  z-index: 9999;
  transition: width 0.1s ease;
}

/* Article detail styles */
.article-detail {
  padding: 60px 0;
}

.article-header {
  margin-bottom: 40px;
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.article-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-featured-image {
  max-height: 500px;
  overflow: hidden;
  border-radius: 12px;
}

.article-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.article-share .btn {
  padding: 10px 20px;
}

/* Articles similaires */
.article-card {
  transition: transform 0.3s ease;
}

.article-card:hover {
  transform: translateY(-5px);
}

.article-card-title {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .article-title {
    font-size: 1.8rem;
  }
  
  .article-content {
    font-size: 1rem;
  }
}
/* Page article show fin*/
/* ====================================== */

 /* utilsateur & admin design */
/* Sidebar styles */
.sidebar {
  background-color: #E6DCC7;
  color: #000000;
  height: 100vh;
  position: fixed;
  width: 260px;
  left: 0;
  top: 0;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.logo-container {
  padding: 20px;
  border-bottom: 1px solid #000000;
}

.logo {
  max-width: 180px;
}

.nav-menu {
  padding: 15px 0;
}

.nav-menu a {
  color: #000000;
  text-decoration: none;
  display: block;
  padding: 12px 20px;
  transition: all 0.3s;
  border-left: 4px solid transparent;
}

.nav-menu a:hover, .nav-menu a.active {
  background-color: #ffffff;
  color: #AA532C;
  border-left: 4px solid #AA532C;
}

.nav-menu i {
  margin-right: 10px;
}

.disconnect-btn {
  position: absolute;
  bottom: 20px;
  width: 90%;
  margin: 0 5%;
}

/* Main content area */
.main-content {
  margin-left: 260px;
  padding: 20px 30px;
  min-height: 100vh;
  transition: all 0.3s;
}

/* Cards styling */
.content-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 25px;
  margin-bottom: 20px;
}

.card-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

/* Form elements styling */
.form-label {
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
}

.form-control, .form-select {
  border-radius: 6px;
  padding: 10px 15px;
  border: 1px solid #ddd;
  transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
  border-color: #D8D6D2;
  box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25);
}

textarea.form-control {
  min-height: 120px;
}

/* Table styling */
.table-container {
  background-color: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.table {
  margin-bottom: 0;
}

.table-dark {
  background-color: #212529;
}

.table th {
  font-weight: 600;
  padding: 15px;
  vertical-align: middle;
}

.table td {
  padding: 15px;
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0,0,0,0.02);
}

/* Buttons styling */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s;
}

.btn-warning {
  background-color: #AA532C;
  border-color: #AA532C;
  color: #ffffff;
}

.btn-warning:hover {
  background-color: #D8D6D2;
  border-color: #D8D6D2;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #218838;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #c82333;
}

/* Image preview */
.img-preview {
  max-width: 200px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.img-kare {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

/* Dropdown styling */
.dropdown-menu {
  padding: 8px 0;
  border: none;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border-radius: 6px;
}

.dropdown-item {
  padding: 8px 20px;
  transition: all 0.2s;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-divider {
  margin: 8px 0;
  border-top: 1px solid #eee;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

/* utilsateur & admin design */